const  express  =  require("express")
const  router  =  express.Router()
const conn = require("../mysql")


router .get('/getRecommend', (req, res) => {
    let { type, floor } = req.query
    let sql = `select * from smallpet_page where type = ${type} and floor = ${floor}`
    conn.query(sql, (err, data) => {
        if (err) {
            console.log(err);
        } else {
            if (data.length) {
                res.send({
                    code: 1,
                    data
                })
            } else {
                res.send({
                    code: 0
                })
            }
        }
    })
})

module.exports  =  router;